<template>
	<uni-popup ref="playPhoneRef" background-color="#fff" type="center">
		<view class="bg-white p-20 relative flex flex-col justify-center rounded-lg"
			style="width: 570rpx;padding-top: 70rpx;">
			<view class="absolute rounded-full overflow-hidden"
				style="width: 100rpx;height: 100rpx;top: -50rpx;left: calc(50% - 50rpx);">
				<image :src="info?.headimg" style="width: 100rpx;height: 100rpx;" mode=""></image>
			</view>
			<view class="flex justify-center">
				<text>邀请</text>
				<text class="text-[#0094FF] font-bold ml-8">{{info?.name}}</text>
			</view>
			<view class="flex justify-center">
				<text>一对一咨询解惑</text>
			</view>
			<view class="flex justify-around mt-20">
				<image src="/static/live/red_button.png" style="width: 220rpx;height: 60rpx;" mode="aspectFit"
					@click="onYes('red')"></image>
				<image src="/static/live/blue_button.png" style="width: 220rpx;height: 60rpx;" mode="aspectFit"
					@click="onYes('blue')"></image>
			</view>
		</view>
	</uni-popup>

</template>

<script setup>
	import {
		ref
	} from 'vue';

	const playPhoneRef = ref()
	let info = {}
	const show = (type, obj) => {
		if (type) playPhoneRef.value.open()
		else playPhoneRef.value.close()
		if (obj) info = obj
	}
	const onYes = (type) => {
		playPhoneRef.value.close()
		uni.navigateTo({
			url: `/pages/views/makePhone?type=send&fromAccount=${info.fromAccount}&phoneType=${type}&info=${JSON.stringify({name:info.name,headimg:info.headimg})}`
		})
	}
	defineExpose({
		show
	})
</script>

<style lang="less">

</style>